/* 排行榜页面样式 */

/* 主要内容布局 */
.leaderboard {
    padding: 2rem 1rem;
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(100vh - 70px - 300px);
    margin-top: 70px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 排行榜筛选器 */
.leaderboard-filters {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-select {
    background-color: var(--background-color);
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236C5CE7'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* 排行榜内容 */
.leaderboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* 游戏排行榜卡片 */
.game-leaderboard {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-leaderboard:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.leaderboard-header {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.game-title {
    color: white;
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 排行榜列表 */
.rankings-list {
    padding: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.3s ease;
}

.ranking-item:hover {
    background-color: rgba(108, 92, 231, 0.1);
}

.rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-1 {
    background-color: #FFD700;
    color: var(--background-color);
}

.rank-2 {
    background-color: #C0C0C0;
    color: var(--background-color);
}

.rank-3 {
    background-color: #CD7F32;
    color: var(--background-color);
}

.rank-other {
    background-color: var(--primary-color);
    color: white;
    opacity: 0.8;
}

.player-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.player-score {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.875rem;
}

.score-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.score-date {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* 查看更多按钮 */
.view-more {
    display: block;
    text-align: center;
    padding: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    border-top: 1px solid rgba(108, 92, 231, 0.1);
    transition: background-color 0.3s ease;
}

.view-more:hover {
    background-color: rgba(108, 92, 231, 0.1);
}

/* 排行榜切换标签 */
.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: var(--text-primary);
    background-color: rgba(108, 92, 231, 0.1);
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .leaderboard-content {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.loading {
    background: linear-gradient(to right, var(--surface-color) 8%, var(--primary-color) 18%, var(--surface-color) 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s linear infinite;
    border-radius: var(--radius-sm);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    margin: 0;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: rgba(30, 27, 46, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}
